package io.github.jsp.executor;

import io.github.jsp.model.JobInfo;
import io.github.jsp.model.JobLog;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

@Component
public class SampleJobHandler implements JobHandler {
    
    private static final Logger logger = LoggerFactory.getLogger(SampleJobHandler.class);
    
    @Override
    public void execute(JobInfo jobInfo, JobLog jobLog) throws Exception {
        logger.info("Executing sample job: id={}, param={}", jobInfo.getId(), jobInfo.getJobParam());
        
        Thread.sleep(1000);
        
        logger.info("Sample job completed: id={}", jobInfo.getId());
    }
}